import request from '@/utils/request'

// 列表
export function getList(data) {
  return request({
    url: '/bus/illPatient/queryPage',
    method: 'post',
    data: data
  })
}

export function importData(data) {
  return request({
    url: '/bus/medicine/importData',
    method: 'post',
    data: data
  })
}
export function downTemplate(data) {
  return request({
    url: '/bus/medicine/importTemplate',
    method: 'post',
    data: data
  })
}
export function delData(data) {
  return request({
    url: '/bus/medicine/' + data,
    method: 'delete',
    data: data
  })
}
export function cleanData() {
  return request({
    url: '/bus/medicine/clean',
    method: 'delete'
  })
}
//详情接口
export function getDetail(data) {
  return request({
    url: '/bus/illPatient/' + data,
    method: 'get'
  })
}
//删除图片接口
export function removePic(data) {
  return request({
    url: '/bus/illPatient/remove/pic/' + data,
    method: 'post'
  })
}
//上传图片接口
export function uploadPic(data, path) {
  return request({
    // url: '/common/uploadPc/illPatient',
    url: `/common/uploadPc/${path}`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
export function downData(data) {
  return request({
    url: '/bus/illPatient/batchDownload/'+data.id,
    method: 'post',
    responseType: 'blob',
    data: data
  })
}
// 多条数据勾选批量下载
export function selectBatchDownload(data) {
  return request({
    url: '/bus/illPatient/selectBatchDownload/'+data,
    method: 'post',
    
  })
}
//  多条数据勾选批量下载进度查看
export function getPercent(data) {
  return request({
    url: '/bus/illPatient/getPercent/' + data,
    method: 'get'
  })
}
// 下载 
export function download(data) {
  return request({
    url: '/bus/illPatient/download' + data,
    headers: {
      'Content-Type': 'application/json;charset=utf-8 '
    },
    responseType: 'blob',
    method: 'get'
  })
}
// 草稿箱列表
export function illPatientDraftList(data) {
  return request({
    url: '/bus/illPatientDraft/queryPage',
    method: 'post',
    data: data
  })
}
// 删除草稿
export function delById(id) {
  return request({
    url: '/bus/illPatientDraft/removeById/' + id,
    method: 'post'
  })
} 
//  导入模板下载
export function illPatientDownload(data) {
  return request({
    url: '/bus/illPatient/importTemplate',
    headers: {
      'Content-Type': 'application/json;charset=utf-8 '
    },
    responseType: 'blob',
    method: 'post'
  })
}
// /dev-api/bus/illPatient/batchQueryImportTemplate
